/****************************************************************************/
/* NAME:           oscillator.h                                             */
/* PURPOSE:        Manage all oscillator                                    */
/* CREATED_BY:     Vyx                                                      */
/* CREATION_DATE:  07/07/2012                                               */
/************************************** (C) Copyright 2012 AquaLink *********/

#include "main.h"

typedef struct
{
    uint8_t   id;            /* oscillator ID                           */
    uint8_t   osci_x_min;    /* position min                            */
    uint8_t   osci_x_max;    /* Position max                            */
    uint32_t  osci_x_speed;  /* Oscillator speed                        */
    bool      osci_x_linear; /* Linaer mode : TRUE, random mode : FALSE */
    uint32_t  osci_x_pause;  /* Time wait between two position          */
}Oscillator_def_t;

/**
  * @brief  Main function of oscillator.
  * @param  none
  * @retval None
  */
void vTaskCTRL_OSCILLATOR();

/**
  * @brief  Manage oscillator 1.
  * @param  none
  * @retval None
  */
void vTask_OSCILLATOR_1();

/**
  * @brief  Manage oscillator 2.
  * @param  none
  * @retval None
  */
void vTask_OSCILLATOR_2();

/**
  * @brief  Set oscillator mode
  * @param  none
  * @retval None
  */
void Osci_SetMode(uint8_t id, bool mode);

/**
  * @brief  Set oscillator speed
  * @param  none
  * @retval None
  */
void Osci_SetSpeed(uint8_t id, uint32_t speed);

/**
  * @brief  Set oscillator min
  * @param  none
  * @retval None
  */
void Osci_SetMin(uint8_t id, uint8_t min);

/**
  * @brief  Set oscillator max
  * @param  none
  * @retval None
  */
void Osci_SetMax(uint8_t id, uint8_t max);

/**
  * @brief  Set oscillator pause
  * @param  none
  * @retval None
  */
void Osci_SetPause(uint8_t id, uint32_t pause);

/**
 * @brief  Get oscillator mode
 * @param  none
 * @retval None
 */
bool Osci_GetMode(uint8_t id);

/**
 * @brief  Get oscillator speed
 * @param  none
 * @retval None
 */
uint32_t Osci_GetSpeed(uint8_t id);

/**
 * @brief  Get oscillator min
 * @param  none
 * @retval None
 */
uint8_t Osci_GetMin(uint8_t id);

/**
 * @brief  Get oscillator max
 * @param  none
 * @retval None
 */
uint8_t Osci_GetMax(uint8_t id);

/**
 * @brief  Get oscillator pause, juste for ramdom mode, time between two random position
 * @param  none
 * @retval None
 */
uint32_t Osci_GetPause(uint8_t id);
